package be.bonamis.timesheet.service;

import java.util.List;

import be.bonamis.timesheet.dto.PrestationTypeDTO;
import be.bonamis.timesheet.model.PrestationType;

/**
 * Declares methods used to obtain and modify PrestationType information.
 * @author Florent Bonamis
 */
public interface PrestationTypeService {

    /**
     * Creates a new prestationType.
     * @param prestationTypeDTO   The information of the created prestationType.
     * @return  The created prestationType.
     */
    public PrestationType create(PrestationTypeDTO prestationTypeDTO);

    /**
     * Deletes a prestationType.
     * @param prestationTypeId  The id of the deleted prestationType.
     * @return  The deleted prestationType.
     * @throws ProjectNotFoundException  if no prestationType is found with the given id.
     */
    public PrestationType delete(Long prestationTypeId) throws ProjectNotFoundException;

    /**
     * Finds all prestationTypes.
     * @return  A list of prestationTypes.
     */
    public List<PrestationType> findAll();

    /**
     * Finds prestationType by id.
     * @param id    The id of the wanted prestationType.
     * @return  The found prestationType. If no prestationType is found, this method returns null.
     */
    public PrestationType findById(Long id);

    /**
     * Updates the information of a prestationType.
     * @param updated   The information of the updated prestationType.
     * @return  The updated prestationType.
     * @throws ProjectNotFoundException  if no prestationType is found with given id.
     */
    public PrestationType update(PrestationType updated) throws ProjectNotFoundException;
}
